package com.zkr.subclass.mapper;

import com.zkr.subclass.model.SubClassSelectVo;
import com.zkr.subclass.model.SubClassVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 *Created by lenovo on 2020/12/10.
 */
@Mapper
public interface SubClassMapper {


     int queryCount(SubClassSelectVo subClassSelectVo);


    List<SubClassVo> queryPage(SubClassSelectVo subClassSelectVo) ;

    @Select("select * from subclass where name = #{name}")
    SubClassVo queryByName(@NotBlank(message = "名称不能为空！") String name);

    @Select("select * from subclass where code = #{code}")
    SubClassVo queryByCode(@NotBlank(message = "编码不能为空！") String code);

    @Insert("insert into subclass (name,code,remark,status,createName,createTime,updateName,updateTime)" +
    "values (#{name},#{code},#{remark},#{status},#{createName},#{createTime},#{updateName},#{updateTime})")
    void insertSubClass(SubClassVo subClassVo);


    SubClassVo queryById(Integer id);

    int  update(SubClassVo subClassVo1);

    void updateStatus(SubClassVo subClassVo1);



    /*AllRecords<SubClass> queryPage(SubSelectVo SubSelectVo);

    List<SubClass> queryUserAll();

    String add(@Valid SubClass SubClass);

    int update(SubClass SubClass);

    int queryCount(SubSelectVo SubSelectVo);

    List<SubClass> queryData(SubSelectVo SubSelectVo);
*/

    // AllRecords<SubClass> queryPage(SubClass SubClass);
}
